x86/mce: handle reserved domain ID in XEN_MC_msrinject
authorHaozhong Zhang <haozhong.zhang@intel.com>
Wed, 8 Jun 2016 09:08:55 +0000 (11:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Jun 2016 09:08:55 +0000 (11:08 +0200)
commite63888627acb094904eef5fa1eea1ef930876258
tree4705c17e82d3fb7488105e749b27069922087cc0
parent936a7a5483fbdd4ae3d813beff8921e902f43a46
x86/mce: handle reserved domain ID in XEN_MC_msrinject

Commit 26646f3 "x86/mce: translate passed-in GPA to host machine
address" and commit 4ddf474 "tools/xen-mceinj: Pass in GPA when
injecting through MSR_MCI_ADDR" forgot to consider reserved domain
ID and mistakenly add MC_MSRINJ_F_GPADDR flag for them, which in turn
causes bug reported by
http://lists.xenproject.org/archives/html/xen-devel/2016-05/msg02640.html.

This patch removes MC_MSRINK_F_GPADDR flag and checks this when injecting
to reserved domain IDs except DOMID_SELF, and treats the passed-in
address as host machine address.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Christoph Egger <chegger@amazon.de>
tools/tests/mce-test/tools/xen-mceinj.c
xen/arch/x86/cpu/mcheck/mce.c